#ifndef WIDGET_H
#define WIDGET_H

#include <Qt>
#include <QDebug>
#include <QWidget>
#include <QMouseEvent>
#include <QLabel>
#include <QImage>
#include <QPixmap>
#include <QPainter>
#include <QPen>
#include <QBrush>
#include <QColor>
#include <QBasicTimer>

//================= 按钮类 =================//

//================= 界面类 =================//
#include "widget_funca_smart_chat.h"
#include "widget_funcb_smart_vision.h"
#include "widget_funcc_smart_home.h"
#include "widget_funcd_weather.h"
#include "widget_funce_control_industrial.h"
#include "widget_funcf_control_motor.h"

//================= page 页面编号 =================//
#define PAGE_SMART_CHAT         1           // 智能对话
#define PAGE_VISION_RECOG       2           // 视觉识别
#define PAGE_SMART_HOME         3           // 智能家居
#define PAGE_WEATHER            4           // 天气预报
#define PAGE_CONTROL_SCREEN     5           // 工控大屏
#define PAGE_MOTOR              6           // 电机控制



QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT
    
public:
    Widget(QWidget *parent = nullptr);
    ~Widget() ;

protected:
    // 绘图事件
    void paintEvent(QPaintEvent *event);
    
    // 进入事件
    void enterEvent(QEvent *event);
    
    // 离开事件
    void leaveEvent(QEvent *event);
    
    // 按下事件
    void mousePressEvent(QMouseEvent *event);
    
    // 释放事件
    void mouseReleaseEvent(QMouseEvent *event);
    
    // 移动事件
    void mouseMoveEvent(QMouseEvent *event);
    
    //时间事件
    void timerEvent(QTimerEvent *event);
    
protected:
    //标题
    QLabel *Window_Title;
    //鼠标坐标
    QPoint Mouse_Press_Pos;
    //界面类
    // 页面类
    Widget_funcA_Smart_chat             *       Widget_Smart_chat;              // 智能对话
    widget_funcb_smart_vision           *       Widget_Smart_vision;            // 视觉识别
    widget_funcc_smart_home             *       Widget_Smart_Home;              // 智能家居
    widget_funcd_weather                *       Widget_Weather;                 // 天气预报
    Widget_funcE_Control_industrial     *       Widget_Control_industrial;      // 工控大屏
    Widget_funcF_Control_motor          *       Widget_Control_motor;           // 电机控制
    
protected slots:
    void slots_click_menu();
    
private:
    Ui::Widget *ui;
private:
    bool m_dragging;
    QPoint m_dragStartPosition;
    QBasicTimer m_pressTimer;
};
#endif // WIDGET_H
